import { createRouter, createWebHistory } from 'vue-router'
import Book from "@/views/Showroom";
import User from "@/views/User";


const routes = [
  // {
  //   path:'/',
  //   redirect: '/login'
  // },
  {
    path: '/',
    name: 'Layout',
    component: import("@/Layout/Layout"),
    redirect :'/user',
    children :[
      {
        path: 'user',
        name: 'User',
        component: import('../views/User.vue'),
      },
      {
        path: 'showroom',
        name: 'Showroom',
        component: import('../views/Showroom')
      },
      {
        path: 'exhibit',
        name: 'Exhibit',
        component: import('../views/Exhibit')
      },
      {
        path: 'news',
        name: 'News',
        component: import('../views/News')
      },
      {
        path: 'booking',
        name: 'Booking',
        component: import('../views/Booking')
      },
      {
        path: '/person',
        name:'/Person',
        component: ()=>import("@/views/Person")
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: ()=>import("@/views/Login")
  },
  {
    path: '/register',
    name: 'Register',
    component: ()=>import("@/views/Register")
  },
  {
    path: '/index',
    name: 'Index',
    component: ()=>import("@/views/User/Index")
  }

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
